﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Mukhopatro.BusinessEntities;

namespace Mukhopatro.BusinessLogicLayer
{
    public partial class CustomerBLL
    {
        public Customer GetCustomer(Func<Customer, bool> query)
        {
            try
            {
                Customer results = _socialShareDatabaseContext.Customers.FirstOrDefault(query);
                return results;
                
            }
            //handling other exceptions...
            catch (Exception ex)
            {
                //Error handling
                return null;
            }
        }

        public List<Customer> GetCustomers(Func<Customer, bool> query)
        {
            try
            {
                List<Customer> result = _socialShareDatabaseContext.Customers.Where(query).ToList();
                return result;
            }
            //handling other exceptions...
            catch (Exception ex)
            {
                //Error handling
                return null;
            }
        }
    }
}